package conf

var (
	Config = &config{}
)

type config struct {
	App        app      `toml:"app" json:"app" yaml:"app"`
	Database   database `toml:"database" json:"database" yaml:"database"`
	RedisTest  redis    `toml:"redis_test" json:"redis_test" yaml:"redis_test"`
	RedisDaily redis    `toml:"redis_daily" json:"redis_daily" yaml:"redis_daily"`
	RedisScore redis    `toml:"redis_score" json:"redis_score" yaml:"redis_score"`
	RedisTick  redis    `toml:"redis_tick" json:"redis_tick" yaml:"redis_tick"`
	Tencent    tencent  `toml:"tencent" json:"tencent" yaml:"tencent"`
	Http       http     `toml:"http" json:"http" yaml:"http"`
}

type app struct {
	Host     string `toml:"host" json:"host" yaml:"host"`
	Port     int    `toml:"port" json:"port" yaml:"port"`
	PageNo   int64  `toml:"page_no" json:"page_no" yaml:"page_no"`
	PageSize int64  `toml:"page_size" json:"page_size" yaml:"page_size"`
}

type database struct {
	Host     string `toml:"host" json:"host" yaml:"host"`
	Port     int    `toml:"port" json:"port" yaml:"port"`
	Username string `toml:"username" json:"username" yaml:"username"`
	Password string `toml:"password" json:"password" yaml:"password"`
	Database string `toml:"database" json:"database" yaml:"database"`
	// MaxIdle  int    `toml:"max_idle" json:"max_idle" yaml:"max_idle"`
	// MaxOpen  int    `toml:"max_open" json:"max_open" yaml:"max_open"`
	ShowSQL bool `toml:"show_sql" json:"show_sql" yaml:"show_sql"`
}

type redis struct {
	Host     string `toml:"host" json:"host" yaml:"host"`
	Port     int    `toml:"port" json:"port" yaml:"port"`
	Password string `toml:"password" json:"password" yaml:"password"`
	Database int    `toml:"database" json:"database" yaml:"database"`
}

type tencent struct {
	Key      string `toml:"key" json:"key" yaml:"key"`
	Secret   string `toml:"secret" json:"secret" yaml:"secret"`
	Endpoint string `toml:"endpoint" json:"endpoint" yaml:"endpoint"`
	Region   string `toml:"region" json:"region" yaml:"region"`
}

type http struct {
	BaseURL string `toml:"base_url" json:"base_url" yaml:"base_url"`
}
